package com.yunzone.cloud.module.pay.service;

import com.yunzone.cloud.common.entity.Result;
import com.yunzone.cloud.modules.payment.entity.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@Component
@FeignClient(value="CLOUD-PAYMENT-SERVICE")
//此处需要告知具体调用哪个微服务
public interface PaymentFeignService {

    @GetMapping("/payment/query/{id}")
    public Result<Payment> query(@PathVariable("id") Long id);

    @PostMapping("/payment/add")
    public Result add(@RequestBody Payment payment) ;

    @GetMapping("/payment/timeout")
    public String timeout();
}
